<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_account_h5_to_apk_url', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('H5转端apk包下载');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('game_id')->comment('转到哪个游戏id')->unsigned()->default(0);
            $table->integer('channel')->comment('转到哪个渠道')->unsigned()->default(0);
            $table->char('token', 32)->comment('官方用户快速登录token')->default('');
            $table->char('account_openid', 32)->comment('官方用户openid')->default('');
            $table->string('android_url', 255)->comment('安卓下载链接')->default('');
            $table->string('ios_url', 255)->comment('ios下载链接')->default('');
            $table->tinyInteger('status')->comment('状态')->unsigned()->default(0);
            $table->integer('status_time')->comment('状态时间')->unsigned()->default(0);

            $table->index('game_id');
            $table->index('channel');
            $table->index('token');
            $table->index('account_openid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_account_h5_to_apk_url');
    }
};
